home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1469 / options.frm (.txt) < prev    next >
Visual Basic Form  |  1996-07-28  |  10KB  |  326 lines

  1. VERSION 4.00
  2. Begin VB.Form frmOptions 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "VBMax Electronic Message Demo - Options"
  5.    ClientHeight    =   5160
  6.    ClientLeft      =   1350
  7.    ClientTop       =   1230
  8.    ClientWidth     =   6615
  9.    Height          =   5565
  10.    Icon            =   "Options.frx":0000
  11.    Left            =   1290
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5160
  17.    ScaleWidth      =   6615
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   885
  20.    Width           =   6735
  21.    Begin VB.CommandButton cmdCancel 
  22.       Cancel          =   -1  'True
  23.       Caption         =   "&Close"
  24.       Height          =   435
  25.       Left            =   4380
  26.       TabIndex        =   26
  27.       Top             =   4560
  28.       Width           =   2175
  29.    End
  30.    Begin VB.Frame Frame1 
  31.       Caption         =   "Update interval"
  32.       Height          =   1170
  33.       Left            =   60
  34.       TabIndex        =   9
  35.       Top             =   3840
  36.       Width           =   1935
  37.       Begin VB.TextBox txtInterval 
  38.          Height          =   315
  39.          Left            =   1140
  40.          MaxLength       =   4
  41.          TabIndex        =   11
  42.          Text            =   "20"
  43.          Top             =   300
  44.          Width           =   615
  45.       End
  46.       Begin VB.CommandButton cmdUpdateInterval 
  47.          Caption         =   "Set Interval"
  48.          Height          =   315
  49.          Left            =   120
  50.          TabIndex        =   12
  51.          Top             =   720
  52.          Width           =   1695
  53.       End
  54.       Begin VB.Label Label1 
  55.          AutoSize        =   -1  'True
  56.          Caption         =   "Milliseconds:"
  57.          Height          =   195
  58.          Left            =   180
  59.          TabIndex        =   10
  60.          Top             =   360
  61.          Width           =   900
  62.       End
  63.    End
  64.    Begin VB.Frame Frame2 
  65.       Caption         =   "Scroll amount"
  66.       Height          =   1695
  67.       Left            =   60
  68.       TabIndex        =   4
  69.       Top             =   2040
  70.       Width           =   1935
  71.       Begin VB.OptionButton optScrollAmount 
  72.          Caption         =   "One segment"
  73.          Height          =   315
  74.          Index           =   0
  75.          Left            =   180
  76.          TabIndex        =   5
  77.          Top             =   360
  78.          Value           =   -1  'True
  79.          Width           =   1575
  80.       End
  81.       Begin VB.OptionButton optScrollAmount 
  82.          Caption         =   "Two segments"
  83.          Height          =   315
  84.          Index           =   1
  85.          Left            =   180
  86.          TabIndex        =   6
  87.          Top             =   660
  88.          Width           =   1575
  89.       End
  90.       Begin VB.OptionButton optScrollAmount 
  91.          Caption         =   "Three segments"
  92.          Height          =   315
  93.          Index           =   2
  94.          Left            =   180
  95.          TabIndex        =   7
  96.          Top             =   960
  97.          Width           =   1575
  98.       End
  99.       Begin VB.OptionButton optScrollAmount 
  100.          Caption         =   "Entire character"
  101.          Height          =   315
  102.          Index           =   3
  103.          Left            =   180
  104.          TabIndex        =   8
  105.          Top             =   1260
  106.          Width           =   1575
  107.       End
  108.    End
  109.    Begin VB.Frame Frame4 
  110.       Caption         =   "Colors"
  111.       Height          =   1170
  112.       Left            =   4380
  113.       TabIndex        =   20
  114.       Top             =   2040
  115.       Width           =   2175
  116.       Begin VB.CommandButton cmdBackColor 
  117.          Caption         =   "Set Back Color"
  118.          Height          =   315
  119.          Left            =   120
  120.          TabIndex        =   22
  121.          Top             =   720
  122.          Width           =   1935
  123.       End
  124.       Begin VB.CommandButton cmdForeColor 
  125.          Caption         =   "Set Fore Color"
  126.          Height          =   315
  127.          Left            =   120
  128.          TabIndex        =   21
  129.          Top             =   360
  130.          Width           =   1935
  131.       End
  132.    End
  133.    Begin VB.Frame Frame3 
  134.       Caption         =   "Scrolling"
  135.       Height          =   2970
  136.       Left            =   2220
  137.       TabIndex        =   13
  138.       Top             =   2040
  139.       Width           =   1935
  140.       Begin VB.CommandButton cmdPause 
  141.          Caption         =   "Stop"
  142.          Height          =   315
  143.          Left            =   180
  144.          TabIndex        =   18
  145.          Top             =   2160
  146.          Width           =   1575
  147.       End
  148.       Begin VB.CommandButton cmdRestart 
  149.          Caption         =   "Restart"
  150.          Height          =   315
  151.          Left            =   180
  152.          TabIndex        =   19
  153.          Top             =   2520
  154.          Width           =   1575
  155.       End
  156.       Begin VB.Frame Frame8 
  157.          Caption         =   "Pause"
  158.          Height          =   1290
  159.          Left            =   120
  160.          TabIndex        =   14
  161.          Top             =   420
  162.          Width           =   1695
  163.          Begin VB.CommandButton cmdSetPause 
  164.             Caption         =   "Pause"
  165.             Height          =   315
  166.             Left            =   120
  167.             TabIndex        =   17
  168.             Top             =   840
  169.             Width           =   1455
  170.          End
  171.          Begin VB.TextBox txtPauseInterval 
  172.             Height          =   315
  173.             Left            =   900
  174.             MaxLength       =   4
  175.             TabIndex        =   16
  176.             Text            =   "5"
  177.             Top             =   300
  178.             Width           =   615
  179.          End
  180.          Begin VB.Label Label2 
  181.             AutoSize        =   -1  'True
  182.             Caption         =   "Seconds:"
  183.             Height          =   195
  184.             Left            =   180
  185.             TabIndex        =   15
  186.             Top             =   360
  187.             Width           =   675
  188.          End
  189.       End
  190.    End
  191.    Begin VB.Frame Frame7 
  192.       Caption         =   "Other options"
  193.       Height          =   1110
  194.       Left            =   4380
  195.       TabIndex        =   23
  196.       Top             =   3300
  197.       Width           =   2175
  198.       Begin VB.CheckBox chkNotifyWhenFinished 
  199.          Caption         =   "Notify when finished"
  200.          Height          =   315
  201.          Left            =   180
  202.          TabIndex        =   25
  203.          Top             =   660
  204.          Width           =   1935
  205.       End
  206.       Begin VB.CheckBox chkShowGrid 
  207.          Caption         =   "Show grid"
  208.          Height          =   315
  209.          Left            =   180
  210.          TabIndex        =   24
  211.          Top             =   300
  212.          Value           =   1  'Checked
  213.          Width           =   1215
  214.       End
  215.    End
  216.    Begin VB.Frame Frame5 
  217.       Caption         =   "Caption"
  218.       Height          =   1215
  219.       Left            =   60
  220.       TabIndex        =   1
  221.       Top             =   660
  222.       Width           =   6495
  223.       Begin VB.TextBox txtCaption 
  224.          Height          =   315
  225.          Left            =   180
  226.          TabIndex        =   2
  227.          Text            =   "VBMax Electronic Message ~~~ Try it out - type your own message here. ~~~ "
  228.          Top             =   360
  229.          Width           =   6075
  230.       End
  231.       Begin VB.CommandButton cmdSetCaption 
  232.          Caption         =   "Change caption"
  233.          Height          =   315
  234.          Left            =   180
  235.          TabIndex        =   3
  236.          Top             =   780
  237.          Width           =   6075
  238.       End
  239.    End
  240.    Begin VB.PictureBox picDisplay 
  241.       Height          =   510
  242.       Left            =   60
  243.       ScaleHeight     =   450
  244.       ScaleWidth      =   6435
  245.       TabIndex        =   0
  246.       Top             =   60
  247.       Width           =   6495
  248.    End
  249. Attribute VB_Name = "frmOptions"
  250. Attribute VB_Creatable = False
  251. Attribute VB_Exposed = False
  252. Option Explicit
  253. Dim moEDisp As New CElectronicDisplay
  254. Private Sub Form_Load()
  255.     Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
  256.     With moEDisp
  257.         .BackColor = &H800000
  258.         .ForeColor = &HFFFF00
  259.         Set .Container = picDisplay
  260.         .Caption = txtCaption.Text
  261.     End With
  262. End Sub
  263. Private Sub Form_Unload(Cancel As Integer)
  264.     moEDisp.Shutdown
  265.     Set moEDisp = Nothing
  266.     Set frmOptions = Nothing
  267. End Sub
  268. Private Sub cmdCancel_Click()
  269.     Unload Me
  270. End Sub
  271. Private Sub optScrollAmount_Click(Index As Integer)
  272.     moEDisp.ScrollAmount = Index
  273. End Sub
  274. Private Sub txtCaption_GotFocus()
  275.     With txtCaption
  276.         .SelStart = 0
  277.         .SelLength = Len(.Text)
  278.     End With
  279. End Sub
  280. Private Sub txtInterval_KeyPress(KeyAscii As Integer)
  281.     Select Case KeyAscii
  282.         Case 48 To 57, 8
  283.         Case Else: KeyAscii = 0
  284.     End Select
  285. End Sub
  286. Private Sub cmdUpdateInterval_Click()
  287.     If Len(txtInterval.Text) > 0 Then moEDisp.Interval = CInt(txtInterval.Text)
  288. End Sub
  289. Private Sub txtPauseInterval_KeyPress(KeyAscii As Integer)
  290.     Select Case KeyAscii
  291.         Case 48 To 57, 8
  292.         Case Else: KeyAscii = 0
  293.     End Select
  294. End Sub
  295. Private Sub cmdSetPause_Click()
  296.     moEDisp.Pause txtPauseInterval.Text
  297. End Sub
  298. Private Sub cmdPause_Click()
  299.     moEDisp.Pause
  300. End Sub
  301. Private Sub cmdRestart_Click()
  302.     moEDisp.Restart
  303. End Sub
  304. Private Sub cmdForeColor_Click()
  305.     moEDisp.SelectForeColor
  306. End Sub
  307. Private Sub cmdBackColor_Click()
  308.     moEDisp.SelectBackColor
  309. End Sub
  310. Private Sub cmdSetCaption_Click()
  311.     moEDisp.Caption = txtCaption.Text
  312. End Sub
  313. Private Sub chkShowGrid_Click()
  314.     With moEDisp
  315.         .ShowGrid = Not .ShowGrid
  316.     End With
  317. End Sub
  318. Private Sub chkNotifyWhenFinished_Click()
  319.     With moEDisp
  320.         .NotifyWhenFinished = Not .NotifyWhenFinished
  321.     End With
  322. End Sub
  323. Public Sub VBMaxElectronicDisplay_Finished(roEDisp As CElectronicDisplay)
  324.     MsgBox "The message """ & roEDisp.Caption & """ has reached the end.", vbInformation
  325. End Sub
  326.